#include "../../lib/interface/ServerSocket.h"
#include "../../lib/interface/SocketException.h"
#include <string>
#include <iostream>
int main ( int argc, int argv[] )
{
  std::cout << "running....\n";

  try
    {
      // Create the socket
      ServerSocket server ( 30000 );

      while ( true )
	{

	  ServerSocket new_sock;
	  server.accept ( new_sock );
	  std::string flux="";

	  try
	    {
	      while ( true )
		{
		  std::string data;
		  new_sock >> data;
		  flux = data;
		  new_sock <<"<GRAPPE><MACHINE><IPADRESSE>146.19.17.153 </IPADRESSE><CPU_MHz>1329.919MHZ </CPU_MHz><MODEL_NAME>Intel(R) Pentium(R) M processor 1.60GHz </MODEL_NAME><CPU_FAMILY>6 </CPU_FAMILY><CACHE_SIZE>2048 KB</CACHE_SIZE><BOGOMIPS>2663.29  </BOGOMIPS>     <CPUID_LEVEL>2</CPUID_LEVEL></MACHINE></GRAPPE>";
		}
	    }
	  catch ( SocketException& ) {}

	}

    }
  catch ( SocketException& e )
    {
      std::cout << "Exception was caught:" << e.description() << "\nExiting.\n";
    }

	std::cout << "";
  return 0;
}
